package book;

public class Book {
     private   String name;  //书籍的名称
     private  double price;  //书籍的价格
     private   String author; //书籍的作者
     private boolean state; //书籍当前的状态

    public Book(String name, double price, String author) {
        this.name = name;
        this.price = price;
        this.author = author;
        this.state = true;
    }

    @Override
    public String toString() {
        return "Book{" +
                "name='" + name + '\'' +
                ", price=" + price +
                ", author='" + author + '\'' +
                ((state == true)?"，状态：未借出":"，状态：已借出")+
                '}';
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public boolean getState() {
        return state;
    }

    public void setState(boolean state) {
        this.state = state;
    }
}
